from fastapi import APIRouter, Request, HTTPException, Header

from backend.const import *
from backend.error import error_pydantic_msg
from backend.exception import DuplicateError
from backend.handler import HandleModelSelectInfo
from backend.model import *
from common.response import OkResponse, OkDuplicateAddResponse, BadRequestResponse, ServerErrorResponse


router = APIRouter()


@router.get("/selectinfo")
def model_selectinfo():
    try:
        return OkResponse(data=HandleModelSelectInfo())
    except ValidationError as e:
        print(e.errors())
        return ServerErrorResponse(data=error_pydantic_msg(e))
    except Exception as e:
        return ServerErrorResponse(data=str(e))


